<template>
  <div id="app">
    <el-container>
      <el-header>
        <div class="header">
        <el-row>
          <el-col :span="5">
            <h1 class="header-title">美容美发预约系统</h1>
          </el-col>
          <el-col :span="19" class="right-align">
            <el-menu mode="horizontal" class="menu">
              <el-menu-item index="/userguanli/shouye" @click="toShouYe">首页</el-menu-item>
              <el-menu-item index="/userguanli/gerenxinxi" @click="toGeRenXinXi">个人信息</el-menu-item>
              <el-menu-item index="/userguanli/meirongmeifalayout" @click="toMeiRongMeiFaLayout">美容美发师</el-menu-item>
              <el-menu-item v-if="role == 1" index="/userguanli/huiyuanka" @click="toHuiYuanKa">会员卡</el-menu-item>
              <el-menu-item index="/userguanli/yuyuelayout" @click="toYuYue">预约</el-menu-item>
            </el-menu>
          </el-col>
        </el-row>
        </div>
      </el-header>
      <el-main class="view">
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'AppointmentSystem',
  data() {
    return {
      role: JSON.parse(localStorage.getItem("user")).role
    }
  },
  methods: {
    toShouYe() {
      this.$router.push('/userguanli/shouye');
    },
    toGeRenXinXi() {
      this.$router.push('/userguanli/gerenxinxi');
    },
    toMeiRongMeiFaLayout(){
      this.$router.push('/userguanli/meirongmeifalayout');
    },
    toHuiYuanKa() {
      this.$router.push('/userguanli/huiyuanka');
    },
    toYuYue() {
      this.$router.push('/userguanli/yuyuelayout');
    },
  }
};
</script>
<style scoped>
.header {
margin-top: -40px;
}
.view{
  margin-top: -50px;
}
</style>
